import { defineStore } from "pinia";

export const useCategoryStore = defineStore("category", {
  state: () => ({
    selectedTab: null,
    selectedSecondCategory: null,
    selectedThirdCategory: null,
  }),
  actions: {
    setSelectedSecondCategory(category) {
      this.selectedSecondCategory = category;
    },
    clearSelectedSecondCategory() {
      this.selectedSecondCategory = null;
    },
    setSelectedThirdCategory(category) {
      this.selectedThirdCategory = category;
    },
    clearSelectedThirdCategory() {
      this.selectedThirdCategory = null;
    },
    setSelectedTab(tab) {
      this.selectedTab = tab;
    },
    clearSelectedTab() {
      this.selectedTab = null;
    },
  },
});
